﻿using System;
using System.Collections.Generic;

using RpcClient.Model;

using RpcModel;

namespace RpcClient.Interface
{
    public delegate void ReceiveMsgEvent(IMsg msg);
    public delegate void ReceiveEndEvent(IMsg msg, TcpRemoteReply reply);

    public delegate void SendIng(IRemoteConfig config, IRemote remote, object page, int sendNum);

    public delegate void LoadExtend(string dictate, ref Dictionary<string, string> extend);

    public interface IRpcService
    {
        /// <summary>
        /// 消息发送前
        /// </summary>
        event SendIng SendIng;
        /// <summary>
        /// 回复消息前
        /// </summary>
        event ReceiveMsgEvent ReceiveMsg;
        /// <summary>
        /// 加载扩展事件
        /// </summary>
        event LoadExtend LoadExtend;
        /// <summary>
        /// 启动完成
        /// </summary>
        event Action StartUpComplate;
        /// <summary>
        /// 初始化组件前
        /// </summary>
        event Action InitComplating;
        /// <summary>
        /// 中控服务连通后开始初始化
        /// </summary>
        event Action BeginIniting;
        /// <summary>
        /// 启动前(基础组件初始化完成时调用)
        /// </summary>
        event Action StartUpComplating;
        /// <summary>
        /// 回复结束
        /// </summary>
        event ReceiveEndEvent ReceiveEnd;
    }
}
